package Comp;
import java.awt.*;

import javax.swing.*;
import java.awt.Color;
import javax.swing.JFrame;
import org.jfree.chart.*;
import org.jfree.chart.title.TextTitle;
import org.jfree.data.xy.XYDataset;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;

public class wonkyung_cmp {
/*			이미지 넣기
	ImageIcon wkimg;
	JLabel wklabel;
	
	public JPanel make_Panel(JPanel wkpanel)
	{
		
		wkimg=new ImageIcon("image\\wk.jpg");
		wklabel=new JLabel(wkimg,JLabel.CENTER);
		wkpanel.add(wklabel);
		return wkpanel;
	}

*/
	public JPanel make_Panel(JPanel wkpanel)
	{
		XYSeries series=new XYSeries("Sleep time");
		series.add(5,3);
		series.add(2,6);
		series.add(1,7);
		XYDataset dataset=new XYSeriesCollection(series);
		JFreeChart chart=ChartFactory.createXYAreaChart("Helloooo", "Day", "Sleep", dataset, org.jfree.chart.plot.PlotOrientation.VERTICAL, true, true, false);
		TextTitle subTitle=new TextTitle("wk");
		chart.setBackgroundPaint(Color.WHITE);
		chart.addSubtitle(subTitle);
		ChartPanel chartPanel=new ChartPanel(chart);
		chartPanel.setPreferredSize(new Dimension(250,220));
		wkpanel.add(chartPanel);
		return wkpanel;
	}

}